﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Markup;

namespace Foundation
{
    public class Bonding : MarkupExtension
    {
        private readonly List<object> _items = new List<object>();

        public Bonding(object item)
        {
            _items.Add(item);
        }

        public Bonding(object item1, object item2)
        {
            _items.Add(item1);
            _items.Add(item2);
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            return _items.Aggregate(string.Empty, (current, item) => current + item);
        }
    }
}
